import Login from '../login/login'
import MyIndex from '../mine/myIndex'
import Test from '../mine/test'
import TestAll from '../mine/test/testAll'
import TestSelect from '../mine/test/testSelect'
import TestAdd from '../mine/test/testAdd'
import Contro from '../mine/contro'
import IntorIndex from '../index/intorPage'
import Exam from '../exam/index'
import App from '../App'

import Subject from '../mine/subject'
import Course from '../mine/subject/course'

import Question from '../mine/questionLibrary/question'
//student
import Student from '../authority/student'
import SelectCourse from '../authority/student/selectCourse'
import StudentExam from '../authority/student/studentExam'
import TestInCourse from '../authority/student/testInCourse'
//路由
import { BrowserRouter, Route, Routes } from 'react-router-dom'

import { AuthComponent } from './authComponent'


export default function AllRoute () {
  return (
    <BrowserRouter>
      <Routes>
        <Route path='/' element={<App />}>
          <Route index element={<IntorIndex />} ></Route>
          <Route path='/login' element={<Login />}></Route>
        </Route>
        <Route path='/myIndex' element={
          <AuthComponent>
            <MyIndex />
          </AuthComponent>
        }>
          <Route index element={<Contro />} ></Route>
          <Route path='/myIndex/test' element={<Test />}></Route>
          <Route path='/myIndex/testAll' element={<TestAll />}></Route>
          <Route path='/myIndex/testAdd' element={<TestAdd />}></Route>
          <Route path='/myIndex/testSelect' element={<TestSelect />}></Route>
          <Route path='/myIndex/subject' element={<Subject />}></Route>
          <Route path='/myIndex/course' element={<Course />}></Route>
          <Route path='/myIndex/question' element={<Question />}></Route>
        </Route>
        <Route path='/student' element={
          <AuthComponent>
            <Student />
          </AuthComponent>
        }>
          <Route index element={<SelectCourse />}></Route>
          <Route path='/student/studentExam' element={<StudentExam />}></Route>
          <Route path='/student/testInCourse' element={<TestInCourse />}></Route>
        </Route>
        <Route path='/exam' element={<Exam />}></Route>
      </Routes>
    </BrowserRouter>
  )

}